<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title language="html:setRoleAuthorityPage"></title>
    <link rel="stylesheet" type="text/css" href="/static/common/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/static/common/easyui/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="/static/common/easyui/themes/IconExtension.css">
    <link rel="stylesheet" href="/static/common/pnotify/pnotify.custom.min.css" media="all" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/css/admin.css">
    <link rel="stylesheet" href="/static/common/animate/animate.min.css">
</head>
<body>
<form id="hm-app" action="/intendant/site/sortMenu" method="post">
    <div class="easyui-layout" style="padding:10px 0px 55px 10px;">
        <div style="border:3px solid #09c;border-right:0;">
            <div id="tit">no found</div>
            <div style="padding:8px;">
                <table id="hm_tree" style="" region="center"></table>
            </div>
        </div>
    </div>
    <div id="hm_toolbar">
        <a onclick="javascript:history.back(-1);" class="easyui-linkbutton" iconCls="icon-arrow_turn_left" plain="true" language="html:goback"></a>
        <a id="btn" href="" class="easyui-linkbutton" iconCls="icon-arrow_refresh" plain="true" language="html:refreshCurrent"></a>
        <a onclick="hm.treeCheckAll('hm_tree')" class="easyui-linkbutton" iconCls="icon-arrow_turn_left" plain="true" language="html:treeCheckAll"></a>
        <a onclick="hm.treeCheckUn('hm_tree')" class="easyui-linkbutton" iconCls="icon-arrow_turn_left" plain="true" language="html:treeCheckUn"></a>
        <a href="javascript:void(0)" onclick="hm.getTreeNodes(treeFunc,this)" data-url="/intendant/site/setRoleSubmit" data-id="{{.id}}" class="easyui-linkbutton" iconCls="icon-group_gear" plain="true" language="html:ajaxAuth"></a>
    </div>
</form>
</body>
<script type="text/javascript" src="/static/common/easyui/jquery.min.js"></script>
<script type="text/javascript" src="/static/common/easyui/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/common/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/static/common/pnotify/pnotify.custom.min.js"></script>
<script type="text/javascript" src="/static/admin/js/language.js"></script>
<script type="text/javascript" src="/static/admin/js/global.js"></script>
<script>
var data = $.parseJSON({{.json}});
var lang = hm.getLanguage('easyui-tree');
$('#hm_tree').tree({
    textField:lang,
    data: data,
    animate: true, //折叠动画效果
    checkbox: true, //复选框
    onlyLeafCheck: false, //是否只显示末尾的复选框
    lines: true, //是否显示虚线
    cascadeCheck: false,
    formatter:function(node){
		return node[lang];
	}
});
function treeFunc(data){
    if(data.status == 12){
        parent.hm.notice("warn", data.info);
    } else if(data.status == 11){
        parent.hm.notice("warn", data.info);
    } else if(data.status == 4){
        parent.hm.notice("error", hm.language.authFailed + data.info);
    } else if(data.status == 1){
        parent.hm.notice("success", hm.language.authSuccess);
        hm.reloadPage();
    } else{
        parent.hm.notice("error",hm.language.unknownError);
    }
}
var lang = '',
    currentRole = hm.language.currentRole;
switch ($.cookie('back-language')) {
    case 'cn':
        lang = {{.roleName}};
        break;
    case 'en':
        lang = {{.roleEn}};
        break;
    default:
        lang = {{.roleName}};
}
$('#tit').html(currentRole+"&nbsp;&nbsp;:&nbsp;&nbsp;"+lang);
</script>
</html>
